package com.atguigu.easyexcel;

import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.support.ExcelTypeEnum;
import com.atguigu.easyexcel.entity.ExcelStudentData;
import org.junit.Test;

/**
 * @author dyqstart
 * @create 2021-07-07-17:10
 * @since 1.0.0
 */
public class ExcelReadTest {

    /**
     * 最简单的读
     */
    @Test
    public void simpleRead07(){
        String fileName = "F:\\code2021\\workspaceidea\\springcloud\\alibaba-easyexcel\\01-simpleWrite-07.xlsx";
        //这里默认读取第一个sheet
        EasyExcel.read(fileName, ExcelStudentData.class,new ExcelStudentDataListener()).sheet().doRead();
    }

    @Test
    public void simpleRead03(){
        String fileName = "d:/excel/01-simpleWrite-03.xls";
        // 这里默认读取第一个sheet
        EasyExcel.read(fileName, ExcelStudentData.class, new ExcelStudentDataListener()).excelType(ExcelTypeEnum.XLS).sheet().doRead();
    }
}
